<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>v-model</title>
</head>
<body>
  <div id="app">
    <input type="text" id="txt">
    <p id="show-txt">0</p>
  </div>
  
  <script>
    let obj = {}

    Object.defineProperty(obj, 'txt', {
      get() {
        return obj
      },
      set(newVal) {
        document.getElementById('show-txt').innerHTML = newVal
      }
    })

    document.addEventListener('keyup', function(e) {
      // console.log(e)
      obj.txt = e.target.value
    })
  </script>
</body>
</html>